﻿@model PresentationMVC.Models.JobBookingModel
@using (Ajax.BeginForm("GridviewSearch", "Job", new AjaxOptions { UpdateTargetId = "DivGrid", InsertionMode = InsertionMode.Replace, LoadingElementId = "resultLoadingDiv" }))
{
    <table>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Customer)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.SelectedCustomerId, new SelectList(Model.Customers, "ID", "FirstName", Model.JobBooking.Customer))
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Staff)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.SelectedStaffId, new SelectList(Model.Staffs, "ID", "FirstName", Model.JobBooking.Staff))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.BookingType)
            </td>
            <td class="editor-field">
                @Html.DropDownListFor(m => m.JobBooking.BookingType.ID, new SelectList(Model.BookingTypes, "ID", "Type", Model.JobBooking.BookingType))
            </td>
            <td class="editor-label">
                @Html.LabelFor(m => m.JobBooking.Status)
            </td>
            <td class="editor-label" style="vertical-align: middle;">
                @Html.DropDownListFor(m => m.JobBooking.Status.ID, new SelectList(Model.Statuses, "ID", "Type", Model.JobBooking.Status))
            </td>
        </tr>
        <tr>
            <td class="editor-label">
                Job Booking From Date
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.From, new { @class = "datepicker" })<br />
                @Html.ValidationMessageFor(m => m.From)
            </td>
            <td class="editor-label">
                Job Booking To Date
            </td>
            <td class="editor-label" style="vertical-align: middle;">@Html.TextBoxFor(m => m.To, new { @class = "datepicker" })<br />
                @Html.ValidationMessageFor(m => m.To)
            </td>
        </tr>
        <tr>
            <td>
                <input type="submit" value="Search" />
            </td>
        </tr>
    </table>
}